import store from "../store"
export function toast(msg, type) {
    // 判断type 是成功还是是失败还是警告
    switch (type) {
        case 'dander':
            type = 'icon-toast-shibai_huaban'
            break;
        case 'warnning':
            type = 'icon-toast-jinggao'
            break;
        default:
            type = 'icon-toast_chenggong'
            break;

    }
    console.log(msg, type);
    store.commit('showToast', {
        msg,
        type
    })
    setTimeout(() => {
        store.commit('hideToast')
    }, 1500)
}